package com.zhangbo.study.designpatternlearning.singleton;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class SingletonRun {

    public static final ThreadPoolExecutor THREAD_POOL_EXECUTOR = new ThreadPoolExecutor(10, 10, 10, TimeUnit.MINUTES, new ArrayBlockingQueue<>(200));

    public static void main(String[] args) {
        for (int i = 0 ; i < 100 ; i++) {
            THREAD_POOL_EXECUTOR.execute(new Runnable() {
                @Override
                public void run() {
                    Singleton.getInstance();
                }
            });
        }
        THREAD_POOL_EXECUTOR.shutdown();
    }

}
